%clear all; clc;
%close all;

welf0=load('welf_gains_lbound.txt');    
welf00=load('welf_gains_ubound.txt');

b2=load('bgrid2.txt');
a2=load('agrid2.txt');


NameArray = {'LineStyle','Color','LineWidth'};
ValueArray1 = {'-';[0.078  0.1686  0.549];2}';
ValueArray2 = {'--','-';[0.078  0.1686  0.549],[0.8  0  0];2,2}';  
           
gain_ubound=100*welf00(:,3);
ubounds =   (welf00(:,2)/4.91-1)*100;

nameFig = char([char(label_model) '_' char(label_graph) '_aust_ulim']);
figure('name',nameFig);
P=plot(ubounds,gain_ubound);
AX1 = gca;box on;set(AX1,'FontSize',16,'XTick',-8:4:8,'XLim',[-8 8]);
set(P,NameArray,ValueArray1);grid on;
set(AX1,'YTick',0.055:0.01:0.085 ,'YLim',[-14.8 -14.4],'FontSize',16,'YLim',[0.0549 0.0851],'FontSize',16);
%saveas(gcf, fullfile(plot_path, nameFig),format_chart);
xlabel('$\bar{y}$ (\% deviation from average $y$)','Interpreter','latex','FontSize',16);ylabel('\%','Interpreter','latex','Fontsize',16);
exportfig(gcf, fullfile(plot_path, nameFig),'color','cmyk','resolution',1600);

gain_lbound=100*welf0(:,3);      
lbound=(welf0(:,1)/4.91-1)*100;
            
nameFig = char([char(label_model) '_' char(label_graph) '_aust_llim']);
figure('name',nameFig);
P=plot(lbound,gain_lbound);  
xlabel('$\underline{y}$ (\% deviation from average $y$)','Interpreter','latex','FontSize',16);ylabel('\%','Interpreter','latex','Fontsize',16);%xlabel('lower limit for total income (difference relative to average level)','FontSize',16);ylabel('%','Fontsize',16);

AX1 = gca;box on;set(AX1,'FontSize',16,'XTick',-29:4:-17,'XLim',[-29 -17]);
set(P,NameArray,ValueArray1);grid on;
%saveas(gcf, fullfile(plot_path, nameFig),format_chart);
exportfig(gcf, fullfile(plot_path, nameFig),'color','cmyk','resolution',1600);